﻿class A2.BLK {
	function BLK(target_mc:MovieClip, init:Object) {
		//var tHeight:Number = sideLength*Math.sqrt(3)/2;
		var width, height;
		(init.width != undefined) ? width=init.width : (width=100)+trace('警告:BLK类，未指定width，取特定宽100');
		(init.height != undefined) ? height=init.height : (height=100)+trace('警告:BLK类，未指定height，取特定高100');
		var x = (init.x != undefined) ? init.x : 0;
		var y = (init.y != undefined) ? init.y : 0;
		var color = (init.color != undefined) ? init.color : 0xFF0000;
		var alpha = (init.alpha != undefined) ? init.alpha : 100;
		with (target_mc) {
			beginFill(color, alpha);
			moveTo(x, y);
			lineTo(x+width, y);
			lineTo(x+width, y+height);
			lineTo(x,  y+height);
			endFill();
		}
	}
}
